<template>
    <div>
        <span v-show="status == 'DRAFT'" class="pub-list-draft">{{
            conversion == 'zh' ? text : isApproval ? '待提交审批' : '未提交'
        }}</span>
        <template>
            <span v-if="status === 'SUBMITTED' && isApproval" class="pub-list-audit">{{
                conversion == 'zh' ? text : '审批中'
            }}</span>
            <span v-if="status === 'SUBMITTED' && !isApproval" class="pub-list-audit">{{
                conversion == 'zh' ? text : '已提交'
            }}</span>
        </template>
        <!-- <span v-else class="pub-list-pass">{{ conversion == 'zh' ? text : '已完成' }}</span> -->
        <span v-show="status === 'WRITESUBMITTED'" class="pub-list-draft">{{
            conversion === 'zh' ? text : '销项待提交审核'
        }}</span>
        <span v-show="status === 'WRITEPAST'" class="pub-list-draft">{{
            conversion === 'zh' ? text : '销项审核中'
        }}</span>

        <span v-show="status === 'UPLOAD'" class="pub-list-pass">{{ conversion == 'zh' ? text : '资料上传中' }}</span>
        <span v-if="isFile">
             <span v-show="status === 'PAST'" class="pub-list-archive">信息归档中</span>
             <span v-show="status === 'PASS'" class="pub-list-archive">信息归档中</span>
        </span>
        <span v-else>
             <span v-show="status === 'PAST'" class="pub-list-pass">{{ conversion == 'zh' ? text : '审批通过' }}</span>
             <span v-show="status === 'PASS'" class="pub-list-pass">{{ conversion == 'zh' ? text : '审批通过' }}</span>
        </span>
        <span v-show="status === 'SIGNSTATUS'" class="pub-list-pass">{{ conversion == 'zh' ? text : '会签中' }}</span>
        <span v-show="status === 'REJECTED'" class="pub-list-rejected">{{
            conversion == 'zh' ? text : '审批不通过'
        }}</span>
        <span v-show="status === 'DELETE'" class="pub-list-del">{{ conversion == 'zh' ? text : '已删除' }}</span>
        <span v-show="status === 'STOP'" class="pub-list-del">{{ conversion == 'zh' ? text : '已终止' }}</span>
        <span v-show="status === 'ABOLISH'" class="pub-list-invalid">{{ conversion == 'zh' ? text : '已作废' }}</span>
        <span v-show="status === 'CHANGE'" class="pub-list-draft">{{ conversion == 'zh' ? text : '变更中' }}</span>
        <span v-show="status === 'REVOKE'" class="pub-list-draft">{{ conversion == 'zh' ? text : '已撤销' }}</span>
        <span v-show="status === 'REVOKEIN'" class="pub-list-draft">{{ conversion == 'zh' ? text : '撤销中' }}</span>
        <span v-show="status === 'COMMIT'" class="pub-list-complete">{{ conversion == 'zh' ? text : '已完成' }}</span>
        <span v-show="status === 'AMEND_RECORD'" class="pub-list-draft">{{ conversion == 'zh' ? text : '待补录' }}</span>
        <span v-show="status === 'BUILD'" class="pub-list-draft">{{ conversion == 'zh' ? text : '无施工' }}</span>
        <span v-if="color" :class="colorMap[color]">{{ text }}</span>
    </div>
</template>
<script>
import template from '@/views/construction/gantt/template.vue'

export default {
    components: { template },
    props: {
        status: {
            type: String
        },
        text: {
            type: String
        },
        //是否为信息归档中 信息归档中在商务设计变革中就是审批通过
        isFile:{
          type: Boolean,
            default() {
                return false
            }
        },
        //是否是审批状态的数据
        isApproval: {
            type: Boolean,
            default() {
                return false
            }
        },
        // 有步骤状态的最后一步提交后应该显示为已完成
        step: {
            type: [String, Number],
            default() {
                return '-1'
            }
        },
        conversion: {
            type: String,
            default() {
                return 'zh'
            }
        },
        // blue | green | red | yellow | grey
        color: {
            type: [String, undefined],
            default() {
                return undefined
            }
        }
    },
    data() {
        return {
            colorMap: {
                blue: 'pub-list-audit',
                green: 'pub-list-pass',
                red: 'pub-list-rejected',
                yellow: 'pub-list-draft',
                grey: 'pub-list-del'
            }
        }
    }
}
</script>
<style>
.pub-list-draft::before,
.pub-list-audit::before,
.pub-list-pass::before,
.pub-list-rejected::before,
.pub-list-del::before,
.pub-list-archive::before,
.pub-list-complete::before,
.pub-list-invalid::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 10px;
}

.pub-list-audit::before {
    background-color: rgb(16, 141, 233);
}

.pub-list-pass::before {
    background-color: rgb(0, 168, 84);
}

.pub-list-rejected::before {
    background-color: rgb(254, 85, 0);
}

.pub-list-draft::before {
    background-color: rgb(255, 255, 0);
}

.pub-list-del::before {
    background-color: rgb(173, 173, 173);
}
.pub-list-invalid::before {
    background-color: rgb(173, 173, 173);
}
.pub-list-archive::before{
    background-color: #3780c8;
}
.pub-list-complete::before{
    background-color: rgb(0,168,84)
}
</style>
